//
//  WNCompassViewCollectionViewCell.m
//  bjbus
//
//  Created by 王建华 on 2024/6/3.
//

#import "WNCompassViewCollectionViewCell.h"

@interface WNCompassViewCollectionViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *directionLabel;
@property (weak, nonatomic) IBOutlet UILabel *degreeLabel;

@property (weak, nonatomic) IBOutlet UILabel *drLabel;
@property (weak, nonatomic) IBOutlet UILabel *dlLabel;

@end

@implementation WNCompassViewCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setIndex:(NSIndexPath *)index {
    _index = index;
    
    NSString *d = @"北";
    NSString *dd = @"0";
    NSString *dl = @" ";
    NSString *dr = @" ";
    if (index.item == 1 || index.item == 13) {
        d = @" ";
        dd = @"30";
        dr = @"东";
    }else if (index.item == 2 || index.item == 14) {
        d = @" ";
        dd = @"60";
        dl = @"北";
    }else if (index.item == 3 || index.item == 15) {
        d = @"东";
        dd = @"90";
    }else if (index.item == 4 || index.item == 16) {
        d = @" ";
        dd = @"120";
        dr = @"东";
    }else if (index.item == 5 || index.item == 17) {
        d = @" ";
        dd = @"150";
        dl = @"南";
    }else if (index.item == 6 || index.item == 18) {
        d = @"南";
        dd = @"180";
    }else if (index.item == 7 || index.item == 19) {
        d = @" ";
        dd = @"210";
        dr = @"西";
    }else if (index.item == 8 || index.item == 20) {
        d = @" ";
        dd = @"240";
        dl = @"南";
    }else if (index.item == 9 || index.item == 21) {
        d = @"西";
        dd = @"270";
    }else if (index.item == 10 || index.item == 22) {
        d = @" ";
        dd = @"300";
        dr = @"西";
    }else if (index.item == 11 || index.item == 23) {
        d = @" ";
        dd = @"330";
        dl = @"北";
    }
    
    self.directionLabel.text = d;
    self.degreeLabel.text = dd;
    self.drLabel.text = dr;
    self.dlLabel.text = dl;
}

@end
